package com.aspose.cells;

import java.util.ArrayList;

class zbu {
   private zqa b;
   private WorksheetCollection c;
   private Chart d;
   private int e;
   private zjp f;
   boolean a;
   private boolean g = false;

   zbu(WorksheetCollection var1, int var2, Chart var3, zjp var4, zqa var5) {
      this.e = var1.l();
      this.d = var3;
      this.f = var4;
      this.b = var5;
      this.c = var1;
   }

   void a() throws Exception {
      this.d();
      if (this.c()) {
         this.e();
      }

   }

   private void a(Area var1) throws Exception {
      if (var1 != null) {
         zaw var2 = new zaw(this.e, this.c.m());
         var2.a(var1);
         var2.a(this.b);
         this.a(var1, var2.b());
      }
   }

   private void a(Area var1, boolean var2) throws Exception {
      if (var1 != null) {
         if (var1.a() || var2) {
            zabz var3 = new zabz();
            var3.a(var1.getFillFormat());
            var3.a(this.b);
            PicFormatOption var4 = null;
            if (var1.getFillFormat().getType() == 4) {
               var4 = var1.getFillFormat().getTextureFill().c();
            }

            if (var4 != null) {
               this.b.a((int)4147);
               zask var5 = new zask(var4);
               var5.a(this.b);
               this.b.a((int)4148);
            }
         }

      }
   }

   private void d() throws Exception {
      this.f();
      this.b(0);
      this.b.a((int)4147);
      zavg var1 = new zavg(false);
      var1.a((ChartFrame)this.d.getPlotArea());
      var1.a((zqa)this.b);
      int var2 = this.d.getType();
      if (this.d.c.getCount() != 0) {
         var2 = this.d.c.a(false).j();
      }

      if (ChartCollection.d(var2)) {
         if (ChartCollection.l(var2)) {
            this.a(this.d.getCategoryAxis(), (byte)0, var2, false);
         } else {
            this.a(this.d.getCategoryAxis(), var2, false);
         }

         this.a(this.d.getValueAxis(), (byte)1, var2, false);
         if (ChartCollection.f(var2)) {
            this.c(this.d.o(), var2);
         }
      }

      this.b(this.d.getCategoryAxis());
      this.b(this.d.getValueAxis());
      if (ChartCollection.f(var2) && this.d.o() != null && this.d.o().n() != null) {
         this.b(this.d.getSeriesAxis());
      }

      if (this.d.getPlotArea().getArea().getFormatting() != 1 || this.d.getPlotArea().getBorder().isVisible()) {
         this.b.a((int)4149);
         this.a((ChartFrame)this.d.getPlotArea(), false);
      }

      for(int var3 = 0; var3 < this.d.c.getCount(); ++var3) {
         if (!this.d.c.a(var3).m()) {
            this.a(this.d.c.a(var3), var3 == 0 && !this.g());
         }
      }

      if (this.a) {
         zaym var4 = new zaym();
         var4.a(0, 0, 0, 0);
         var4.a(this.b);
         this.a = false;
      }

      this.b.a((int)4148);
   }

   private void e() throws Exception {
      this.b(1);
      this.b.a((int)4147);
      zavg var1 = new zavg(false);
      var1.a((zqa)this.b);
      int var2 = this.d.getType();
      ziz var3 = this.d.c.a(true);
      if (var3 != null) {
         var2 = var3.j();
      }

      if (ChartCollection.d(var2)) {
         if (ChartCollection.l(var2)) {
            this.a(this.d.getSecondCategoryAxis(), (byte)0, var2, true);
         } else {
            this.a(this.d.getSecondCategoryAxis(), var2, true);
         }

         this.a(this.d.getSecondValueAxis(), (byte)1, var2, true);
      }

      this.b(this.d.getSecondCategoryAxis());
      this.b(this.d.getSecondValueAxis());

      for(int var4 = 0; var4 < this.d.c.getCount(); ++var4) {
         if (this.d.c.a(var4).m()) {
            this.a(this.d.c.a(var4), var4 == 0 && this.g());
         }
      }

      if (this.a) {
         zaym var5 = new zaym();
         var5.a(0, 0, 0, 0);
         var5.a(this.b);
         this.a = false;
      }

      this.b.a((int)4148);
   }

   void a(Axis var1, int var2, boolean var3) throws Exception {
      zbt var4 = new zbt((byte)0);
      var4.a(this.b);
      this.b.a((int)4147);
      this.a(0, var1, var2);
      zbn var5 = new zbn(var1);
      var5.a(this.b);
      var5 = null;
      this.h(var1);
      this.a(var1, var2);
      this.f(var1);
      this.a(var1);
      this.c(var1);
      this.d(var1);
      if (!var3) {
         this.a(var2);
      }

      this.a(var1, false);
      if (var1.a != null) {
         for(int var6 = 0; var6 < var1.a.size(); ++var6) {
            zna var7 = new zna();
            var7.a((byte[])((byte[])var1.a.get(var6)));
            var7.a(this.b);
         }
      }

      if (this.g) {
         zaym var8 = new zaym();
         var8.a(4, 0, 0, 0);
         var8.a(this.b);
         this.g = false;
      }

      this.b.a((int)4148);
   }

   private void a(Axis var1, byte var2, int var3, boolean var4) throws Exception {
      zbt var5 = new zbt(var2);
      var5.a(this.b);
      this.b.a((int)4147);
      zbus var6 = new zbus();
      var6.a(var1);
      var6.a(this.b);
      this.e(var1);
      this.h(var1);
      this.b(var1, var3);
      this.f(var1);
      this.a(var1);
      this.c(var1);
      this.d(var1);
      if (!var4 && ChartCollection.b(var3)) {
         this.b();
      }

      this.a(var1, true);
      if (this.g) {
         zaym var7 = new zaym();
         var7.a(4, 0, 0, 0);
         var7.a(this.b);
         this.g = false;
      }

      this.b.a((int)4148);
   }

   private void a(Axis var1, boolean var2) throws Exception {
      if (var1.b != null && var1.b.size() > 0 || var1.c != null) {
         if (!this.a) {
            zayl var3 = new zayl();
            var3.a(0, 0, 0, 0);
            var3.a(this.b);
            this.a = true;
         }

         int var5;
         if (!this.g) {
            var5 = var2 ? 1 : 0;
            zayl var4 = new zayl();
            var4.a(4, 0, var5, 0);
            var4.a(this.b);
            this.g = true;
         }

         if (var1.b != null && var1.b.size() > 0) {
            for(var5 = 0; var5 < var1.b.size(); ++var5) {
               zbjp var7 = new zbjp();
               var7.a((byte[])((byte[])var1.b.get(var5)));
               var7.a(this.b);
            }
         }

         if (var1.c != null) {
            zbsu var6 = new zbsu();
            var6.a(var1.c);
            var6.a(this.b);
         }
      }

   }

   private void c(Axis var1, int var2) throws Exception {
      zbt var3 = new zbt((byte)2);
      var3.a(this.b);
      this.b.a((int)4147);
      this.a(2, var1, var2);
      this.h(var1);
      zbtl var4 = new zbtl(this.e);
      if (var1 != null) {
         var4.a(var1);
      }

      var4.a(this.b);
      this.f(var1);
      this.a(var1);
      this.c(var1);
      this.d(var1);
      this.b.a((int)4148);
   }

   void a(int var1) throws Exception {
      if (ChartCollection.b(var1) && this.d.t() != null) {
         Walls var2 = this.d.getWalls();
         zbs var3 = new zbs((byte)3);
         var3.a(this.b);
         zalx var4 = new zalx(this.c.l(), this.c.m());
         var4.a(var2.getBorder(), false);
         var4.a(this.b);
         this.a((Area)var2);
      }
   }

   void b() throws Exception {
      if (this.d.s() != null) {
         Floor var1 = this.d.getFloor();
         zbs var2 = new zbs((byte)3);
         var2.a(this.b);
         zalx var3 = new zalx(this.c.l(), this.c.m());
         var3.a(var1.getBorder(), false);
         var3.a(this.b);
         this.a((Area)var1);
      }
   }

   void a(Axis var1) throws Exception {
      if (var1 != null) {
         zbs var2;
         zalx var3;
         if (!var1.isVisible()) {
            var2 = new zbs((byte)0);
            var2.a(this.b);
            var3 = new zalx(this.e, this.c.m());
            var3.a();
            var3.a(this.b);
         } else if (var1.i() != null) {
            var2 = new zbs((byte)0);
            var2.a(this.b);
            var3 = new zalx(this.e, this.c.m());
            var3.a(var1.getAxisLine(), true);
            var3.a(this.b);
         }
      }
   }

   private void a(Font var1, int var2, int var3, ArrayList var4) throws Exception {
      if (var1 != null || var2 != -1) {
         if (var1 != null) {
            var2 = var1.j();
         }

         if (var4 != null) {
            zd var5 = new zd();
            int var6 = var5.a(var3, var2, var4);
            zxs var7;
            if (var6 == -1) {
               var7 = new zxs(var2);
               var7.a(this.b);
               var5.a(this.b);
            } else {
               var7 = new zxs(var6);
               var7.a(this.b);
            }
         } else {
            zxs var8 = new zxs(var2);
            var8.a(this.b);
         }

      }
   }

   void b(Axis var1) throws Exception {
      Title var2 = var1.n();
      if (var2 != null) {
         boolean var3 = var2.getText() != null && !"".equals(var2.getText());
         if (var3 || var2.isAutoText()) {
            zbsv var4 = new zbsv(this.e);
            var4.a(var2);
            var4.a((zqa)this.b);
            this.b.a((int)4147);
            if (var2.u() != 0 || var2.v() != 0 || (var2.getX() != 0 || var2.getY() != 0) && (var2.b() || var2.c()) && var2.v != null && var2.v instanceof Axis) {
               zavg var5 = new zavg(false);
               var5.a(var2);
               var5.a((zqa)this.b);
            }

            this.a(var2.g(), var2.h(), var3 ? var2.getText().length() : 0, var2.D());
            zc var7 = new zc();
            var7.a();
            var7.a(this.b);
            if (var3) {
               zbcw var6 = new zbcw(this.e, var2.getText());
               var6.a(this.b);
            }

            if (var2.H()) {
               this.a((ChartFrame)var2, true);
            }

            zarz var8 = new zarz();
            switch(var1.b()) {
            case 0:
               var8.a((byte)3);
               break;
            case 1:
               var8.a((byte)2);
               break;
            case 2:
               var8.a((byte)7);
            }

            var8.a(this.b);
            this.b.a((int)4148);
         }
      }
   }

   private void a(int var1, Axis var2, int var3) throws Exception {
      zfs var4 = new zfs();
      switch(var3) {
      case 69:
      case 70:
      case 71:
      case 72:
         var4.a(this.e, var1);
      default:
         if (var2 != null) {
            var4.a(var2);
         }

         var4.a(this.b);
      }
   }

   boolean c() {
      if (this.d.getNSeries().getCount() <= 1) {
         return false;
      } else if (this.d.c.b()) {
         return true;
      } else if (this.d.getSecondValueAxis().isVisible()) {
         this.d.getNSeries().get(0).setPlotOnSecondAxis(true);
         return true;
      } else {
         return false;
      }
   }

   private void f() throws Exception {
      this.b.c(4166);
      this.b.c(2);
      if (this.c()) {
         this.b.c(2);
      } else {
         this.b.c(1);
      }

   }

   private void b(int var1) throws Exception {
      this.b.c(4161);
      this.b.c(18);
      this.b.a((short)var1);
      if (this.d.getPlotArea().getInnerWidth() + this.d.getPlotArea().getInnerHeight() == 0) {
         this.d.a(false, false);
         this.d.getPlotArea().e(false);
         this.d.getPlotArea().f(false);
         this.d.getPlotArea().g(false);
         this.d.getPlotArea().h(false);
         this.d.getPlotArea().setInnerMode(false);
         if (this.d.I() != null) {
            long var2 = this.b.b();
            this.b.b(this.d.I().a);
            this.d.I().a(this.d);
            this.d.I().a(this.b);
            this.b.b(var2);
            this.d.a((zbmi)null);
         }
      }

      this.b.a(this.d.getPlotArea().getInnerX());
      this.b.a(this.d.getPlotArea().getInnerY());
      this.b.a(this.d.getPlotArea().getInnerWidth());
      this.b.a(this.d.getPlotArea().getInnerHeight());
   }

   void c(Axis var1) throws Exception {
      if (var1 != null) {
         if (var1.o() != null && var1.getMajorGridLines().isVisible()) {
            zbs var2 = new zbs((byte)1);
            var2.a(this.b);
            zalx var3 = new zalx(this.e, this.c.m());
            var3.a(var1.getMajorGridLines(), false);
            var3.a(this.b);
         }
      }
   }

   void d(Axis var1) throws Exception {
      if (var1 != null) {
         if (var1.p() != null && var1.getMinorGridLines().isVisible()) {
            zbs var2 = new zbs((byte)2);
            var2.a(this.b);
            zalx var3 = new zalx(this.e, this.c.m());
            var3.a(var1.getMinorGridLines(), false);
            var3.a(this.b);
         }
      }
   }

   void e(Axis var1) throws Exception {
      if (var1.getDisplayUnit() != 0) {
         zayl var2;
         if (!this.a) {
            var2 = new zayl();
            var2.a(0, 0, var1.q() ? 0 : 1, 0);
            var2.a(this.b);
            this.a = true;
         }

         if (!this.g) {
            var2 = new zayl();
            var2.a(4, 0, 0, 0);
            var2.a(this.b);
            this.g = true;
         }

         zbqi var3 = new zbqi();
         var3.a(var1.isDisplayUnitLabelShown(), var1.getDisplayUnit());
         var3.a(this.b);
         DisplayUnitLabel var4 = var1.m();
         if (var4 != null) {
            zayn var5 = new zayn();
            var5.a(16);
            var5.a(this.b);
            zayk var6 = new zayk();
            var6.a(var1, var4, this.c.l());
            var6.a((zqa)this.b);
            var6.a();
            var6.a((zqa)this.b);
            var6.a(var4);
            var6.a((zqa)this.b);
            if (var6.b(var4.g(), var4.h())) {
               var6.a((zqa)this.b);
            }

            var6.a(var4.l);
            var6.a((zqa)this.b);
            if (var4.getText() != null && var4.getText().length() != 0) {
               var6.a(this.c.l(), var4.getText());
               var6.a((zqa)this.b);
            }

            if (!var4.q() && var4.C()) {
               var6.a(var4.l(), var4);
               var6.a((zqa)this.b);
               var6.a();
               var6.a((zqa)this.b);
               var6.a(var4.getBorder(), this.c.l(), this.c.m());
               var6.a((zqa)this.b);
               var6.a(var4.getArea(), this.c.l(), this.c.m());
               var6.a((zqa)this.b);
               var6.a(var4.getArea(), this.c.m(), this.b);
               var6.c();
               var6.a((zqa)this.b);
            }

            var6.b();
            var6.a((zqa)this.b);
            var6.c();
            var6.a((zqa)this.b);
            zayo var7 = new zayo();
            var7.a(16);
            var7.a(this.b);
         }

      }
   }

   void a(Axis var1, int var2) throws Exception {
      switch(var2) {
      case 12:
      case 13:
      case 60:
      case 61:
      case 62:
      case 63:
      case 64:
      case 69:
      case 70:
      case 71:
      case 72:
         zbtl var3 = new zbtl(this.e);
         if (var1.j()) {
            var3.a(var1);
         }

         var3.a(this.b);
         break;
      default:
         this.g(var1);
      }

   }

   void b(Axis var1, int var2) throws Exception {
      if (var1.j()) {
         zbtl var3 = new zbtl(this.e);
         var3.a(var1);
         var3.a(this.b);
      }

   }

   void f(Axis var1) throws Exception {
      if (var1 != null && var1.k() != null) {
         this.a(var1.k().a(), var1.k().b(), 0, (ArrayList)null);
      }
   }

   void g(Axis var1) throws Exception {
      TickLabels var2 = var1.k();
      this.g = false;
      int var3 = var2 == null ? 100 : var2.getOffset();
      if (var3 != 100 || var1.getTickLabelSpacing() == 1 && !var1.l()) {
         this.g = true;
         zayl var4 = new zayl();
         if (!this.a) {
            var4.a(0, 0, var1.q() ? 0 : 1, 0);
            var4.a(this.b);
            this.a = true;
         }

         var4.a(4, 0, 0, 0);
         var4.a(this.b);
         zfn var5 = new zfn();
         var5.a(var3, var1.l());
         var5.a(this.b);
      }

      zbtl var6 = new zbtl(this.e);
      var6.a(var1);
      var6.a(this.b);
   }

   void a(Axis var1, Axis var2) throws Exception {
      boolean var3 = var1.getDisplayUnit() == 0 || !var1.isDisplayUnitLabelShown();
      boolean var4 = var2.getDisplayUnit() == 0 || !var2.isDisplayUnitLabelShown();
      if (!var3 || !var4) {
         int var5 = -1;
         int var6 = -1;
         if (!var3) {
            if (var1.getDisplayUnitLabel().g() != null) {
               var5 = var1.getDisplayUnitLabel().getFont().j();
            } else {
               var5 = var1.getDisplayUnitLabel().h();
            }
         }

         if (!var4) {
            if (var2.getDisplayUnitLabel().g() != null) {
               var6 = var2.getDisplayUnitLabel().getFont().j();
            } else {
               var6 = var2.getDisplayUnitLabel().h();
            }
         }

         zayr var7 = new zayr();
         var7.a(var5, var6);
         var7.a(this.b);
         zayn var8 = new zayn();
         var8.a(17);
         var8.a(this.b);
         zayk var9 = new zayk();
         if (var5 != -1) {
            var9.a(var1.getDisplayUnitLabel().getFont(), this.c.l());
            var9.a((zqa)this.b);
            if (var1.getDisplayUnitLabel().getAutoScaleFont()) {
               var9.a((zbi)var1.getDisplayUnitLabel().getFont().c());
               var9.a((zqa)this.b);
            }
         }

         if (var6 != -1) {
            var9.a(var2.getDisplayUnitLabel().getFont(), this.c.l());
            var9.a((zqa)this.b);
            if (var2.getDisplayUnitLabel().getAutoScaleFont()) {
               var9.a((zbi)var2.getDisplayUnitLabel().getFont().c());
               var9.a((zqa)this.b);
            }
         }

         zayo var10 = new zayo();
         var10.a(17);
         var10.a(this.b);
      }
   }

   void h(Axis var1) throws Exception {
      if (var1 != null && var1.k() != null) {
         TickLabels var2 = var1.k();
         if (var2.getNumberFormat() != null && !"".equals(var2.getNumberFormat())) {
            int var3 = var2.d();
            this.b.c(4174);
            this.b.c(2);
            this.b.b(var3);
         } else if (var2.getNumber() != 0) {
            this.b.c(4174);
            this.b.c(2);
            this.b.b(var2.getNumber());
         }

      }
   }

   private boolean g() {
      return this.d.c.a(0).m();
   }

   private void a(ziz var1, boolean var2) throws Exception {
      int var3 = var1.j();
      ziv var4 = new ziv();
      var4.a(var1.k());
      if (var1.y()) {
         var4.a();
      }

      var4.a(this.b);
      this.b.a((int)4147);
      zaug var5;
      zcg var7;
      switch(var3) {
      case 0:
      case 1:
      case 2:
      case 3:
      case 4:
      case 5:
         zay var10 = new zay();
         var10.a(var3);
         var10.a(this.b);
         this.h();
         break;
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      case 11:
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 19:
      case 20:
         var7 = new zcg(this.e, var1.B(), var1.z());
         var7.a(var3, var1.K());
         var7.a(this.b);
         this.h();
         break;
      case 12:
      case 13:
         zbbz var14 = new zbbz(this.e, var1);
         var14.a(this.b);
         break;
      case 21:
      case 22:
      case 23:
      case 24:
      case 25:
      case 26:
      case 27:
      case 28:
      case 29:
      case 30:
      case 31:
      case 32:
      case 33:
      case 34:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
         var7 = new zcg(this.e, var1.B(), this.d.getGapWidth());
         var7.a(var3, var1.K());
         var7.a(this.b);
         this.h();
         break;
      case 35:
      case 36:
         var5 = new zaug(var1);
         var5.a(this.b);
         break;
      case 37:
      case 38:
      case 39:
      case 40:
      case 41:
      case 42:
      case 43:
         zame var6 = new zame();
         var6.a(var1.j());
         var6.a(this.b);
         this.h();
         break;
      case 44:
      case 47:
         var5 = new zaug(var1);
         var5.a(this.b);
         break;
      case 45:
      case 48:
         var5 = new zaug(var1);
         var5.a(this.b);
         this.h();
         break;
      case 46:
      case 49:
         zcz var8 = new zcz(var1);
         var8.a(this.b);
         if (var1.b != null) {
            this.b.a((short)4199);
            this.b.a((short)var1.b.length);
            this.b.a(var1.b);
         }
         break;
      case 57:
      case 58:
         zawd var12 = new zawd(var1);
         var12.a(this.b);
         break;
      case 59:
         zawa var11 = new zawa(var1);
         var11.a(this.b);
         break;
      case 60:
      case 61:
      case 62:
      case 63:
      case 64:
         zbbz var9 = new zbbz(this.e, var1);
         var9.a(this.b);
         break;
      case 65:
      case 66:
      case 67:
      case 68:
      default:
         throw new CellsException(0, "Invalid chart type.");
      case 69:
      case 70:
      case 71:
      case 72:
         zbqj var13 = new zbqj();
         var13.a(var3, var1);
         var13.a(this.b);
         this.h();
      }

      if (this.d.getValueAxis().getDisplayUnit() != 0) {
         ziu var15 = new ziu();
         var15.a();
         var15.a(this.b);
      }

      if (this.d.getShowLegend() && var2) {
         this.i();
      }

      if (var1.t()) {
         this.a(var1);
      }

      if (var1.M() && ChartCollection.c(var3)) {
         this.a((byte)3, var1.N());
      }

      if (var1.p()) {
         this.a((byte)2, var1.q());
      }

      if (var1.r()) {
         this.a((byte)0, var1.s());
      }

      if (var1.n()) {
         this.a((byte)1, var1.o());
      }

      switch(var3) {
      case 13:
      case 21:
      case 22:
      case 23:
      case 24:
      case 25:
      case 26:
      case 27:
      case 28:
      case 29:
      case 30:
      case 31:
      case 32:
      case 33:
      case 34:
      case 36:
      case 37:
      case 38:
      case 39:
      case 47:
      case 48:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
      case 60:
      case 61:
      case 62:
      case 64:
         this.b(var1);
      case 14:
      case 15:
      case 16:
      case 17:
      case 18:
      case 19:
      case 20:
      case 35:
      case 40:
      case 41:
      case 42:
      case 43:
      case 44:
      case 45:
      case 46:
      case 49:
      case 58:
      case 59:
      case 63:
      default:
         this.b.a((int)4148);
      }
   }

   private void a(byte var1, Line var2) throws Exception {
      zjb var3 = new zjb(var1);
      var3.a(this.b);
      zalx var4 = new zalx(this.e, this.c.m());
      var4.a(var2, false);
      var4.a(this.b);
   }

   private void h() throws Exception {
      if (ChartCollection.b(this.d.getType())) {
         zid var1 = new zid();
         var1.a(this.d);
         var1.a(this.b);
      }
   }

   private void a(ziz var1) throws Exception {
      zru var2 = new zru(var1.z());
      var2.a(this.b);
      this.b.a((int)4147);
      DropBars var3 = var1.w();
      zalx var4 = new zalx(5, this.c.m());
      if (var3 != null && var3.a() != null) {
         var4.a(var3.getBorder(), false);
      }

      var4.a(this.b);
      zaw var5 = new zaw(5, this.c.m());
      if (var3 != null) {
         var5.a(var3.getArea());
      }

      var5.a(this.b);
      if (var3 != null) {
         this.a(var3.getArea(), var5.b());
      }

      this.b.a((int)4148);
      var2 = new zru(var1.z());
      var2.a(this.b);
      this.b.a((int)4147);
      var3 = var1.x();
      var4 = new zalx(5, this.c.m());
      if (var3 != null) {
         var4.a(var3.getBorder(), false);
      }

      var4.a(this.b);
      var5 = new zaw(5, this.c.m());
      if (var3 != null) {
         var5.a(var3.getArea());
      }

      var5.a(this.b);
      if (var3 != null) {
         this.a(var3.getArea(), var5.b());
      }

      this.b.a((int)4148);
   }

   private void c(int var1) throws Exception {
      zch var2 = new zch();
      var2.d(var1);
      var2.a(this.b);
   }

   private void b(ziz var1) throws Exception {
      zos var2 = new zos();
      var2.d(var1.j());
      var2.a(this.b);
      this.b.a((int)4147);
      this.c(var1.j());
      zor var3 = var1.d();
      if (var3 == null) {
         this.b.a((int)4148);
      } else {
         if (var3.f() != null) {
            zalx var4 = new zalx(this.e, this.c.m());
            var4.a(var3.f(), false);
            var4.a(this.b);
         }

         if (var3.e() != null) {
            zaw var5 = new zaw(this.e, this.c.m());
            var5.a(var3.e());
            var5.a(this.b);
         }

         if (var3.l() != null) {
            zaud var6 = new zaud();
            var6.a(var3.l());
            var6.a(this.b);
         }

         if (var3.m() || var3.o()) {
            zbco var7 = new zbco(var3.m(), false, var3.o());
            var7.a(this.b);
         }

         if (var3.j() != null) {
            zamv var8 = new zamv(this.c.l(), this.c.m());
            var8.a((Marker)var3.j(), 0);
            var8.a(this.b);
         }

         this.b.a((int)4148);
      }
   }

   private boolean i() throws Exception {
      Legend var1 = this.d.p();
      if (var1 == null) {
         var1 = this.d.getLegend();
      }

      zale var2 = new zale(this.e);
      if (var1 != null) {
         var2.a(this.d.p());
      }

      var2.a((byte)this.d.getLegend().getPosition());
      var2.a(this.b);
      this.b.a((int)4147);
      int[] var4 = null;
      zavg var3;
      if (!this.d.p().i() || !this.d.p().l()) {
         var3 = new zavg(true);
         var4 = var3.a(this.d.getLegend());
         var3.a((zqa)this.b);
      }

      zbsv var5 = new zbsv(this.e);
      int[] var6 = var5.a((ChartFrame)this.d.getLegend());
      var5.a((zqa)this.b);
      this.b.a((int)4147);
      var3 = new zavg(false);
      var3.a((zqa)this.b);
      this.a(this.d.getLegend().g(), this.d.getLegend().h(), 0, (ArrayList)null);
      zc var7 = new zc();
      var7.a();
      var7.a(this.b);
      this.b.a((int)4148);
      boolean var8 = false;
      boolean var9 = false;
      boolean var10 = false;
      zayl var13;
      if (!this.d.p().q()) {
         zabj var11;
         if (var1.l()) {
            var11 = new zabj((byte)3);
         } else {
            var11 = new zabj((byte)2);
         }

         var11.a(var1);
         var11.a(this.b);
         this.b.a((int)4147);
         zalx var12 = new zalx(this.e, this.c.m());
         var12.a(var1.getBorder(), false);
         var12.a(this.b);
         this.a(var1.getArea());
         if (var1.a != null) {
            if (!this.a) {
               var13 = new zayl();
               var13.a(0, 0, 0, 0);
               var13.a(this.b);
               this.a = true;
            }

            var13 = new zayl();
            var13.a(5, 0, 0, 0);
            var13.a(this.b);
            var10 = true;
            zayl var14 = new zayl();
            var14.a(9, 1, 0, 0);
            var14.a(this.b);
            var9 = true;
            var13 = new zayl();
            var13.a(7, 0, 0, 0);
            var13.a(this.b);
            zbjp var15 = new zbjp();
            var15.a((byte[])var1.a);
            var15.a(this.b);
            zaym var16 = new zaym();
            var16.a(7, 0, 0, 0);
            var16.a(this.b);
            var8 = true;
         }

         this.b.a((int)4148);
      }

      boolean var17 = false;
      Legend var18 = this.d.getLegend();
      if (var18.l != null || var18.b != null) {
         var17 = true;
      }

      if (var17) {
         this.a = true;
         if (!var9) {
            var13 = new zayl();
            var13.a(9, 1, 0, 0);
            var13.a(this.b);
            var9 = true;
            var8 = true;
         }

         int var20;
         byte[] var23;
         if (var18.l != null) {
            int var19 = this.a(var18, var4);
            System.arraycopy(com.aspose.cells.b.a.zc.a(var19), 0, var18.l, 12, 4);
            var20 = var18.l.length;
            var23 = new byte[var20 + 4];
            var23[0] = -99;
            var23[1] = 8;
            System.arraycopy(com.aspose.cells.b.a.zc.a(var20), 0, var23, 2, 2);
            System.arraycopy(var18.l, 0, var23, 4, var20);
            this.b.a(var23);
         }

         if (var18.b != null) {
            com.aspose.cells.a.e.zh var21 = new com.aspose.cells.a.e.zh();
            var21.a(zjp.a(var18.getFont(), var6[0], var6[1], var6[2], var6[3], var6[4]));
            var20 = var18.b.length;
            var23 = new byte[var20 + 4];
            var23[0] = -91;
            var23[1] = 8;
            System.arraycopy(com.aspose.cells.b.a.zc.a(var20), 0, var23, 2, 2);
            System.arraycopy(var18.b, 0, var23, 4, var20);
            this.b.a(var23);
         }
      }

      zaym var22;
      if (var9) {
         var22 = new zaym();
         var22.a(9, 0, 0, 0);
         var22.a(this.b);
      }

      this.b.a((int)4148);
      if (var10) {
         var22 = new zaym();
         var22.a(5, 0, 0, 0);
         var22.a(this.b);
      }

      return var8;
   }

   private int a(Legend var1, int[] var2) {
      int var3 = var1.m() ^ var1.n();
      if (var2 != null) {
         var3 ^= (int)((double)((float)(var2[0] * this.c.L()) / 72.0F) + 0.5D);
         var3 ^= (int)((double)((float)(var2[1] * this.c.L()) / 72.0F) + 0.5D);
      }

      var3 ^= var1.j() ? 0 : 1;
      var3 ^= var1.k() ? 0 : 1;
      var3 ^= var1.l() ? 0 : 1;
      return var3;
   }

   void a(ChartFrame var1, boolean var2) throws Exception {
      zabj var3;
      if (var1.l()) {
         var3 = new zabj((byte)3);
      } else {
         var3 = new zabj((byte)2);
      }

      var3.a(var1);
      var3.a(this.b);
      this.b.a((int)4147);
      zalx var4 = new zalx(this.e, this.c.m());
      var4.a(var1.getBorder(), var2);
      var4.a(this.b);
      this.a(var1.getArea());
      if (var1.a != null) {
         zayl var5 = new zayl();
         var5.a(7, 1, 0, 0);
         var5.a(this.b);
         zbjp var6 = new zbjp();
         var6.a(var1.a);
         var6.a(this.b);
         zaym var7 = new zaym();
         var7.a(7, 0, 0, 0);
         var7.a(this.b);
      }

      this.b.a((int)4148);
   }
}
